package com.xiashitech.agent.instrumentation.httprequest;

import javax.servlet.ReadListener;
import javax.servlet.ServletInputStream;
import java.io.ByteArrayInputStream;
import java.io.IOException;

public class XSServletInputStream extends ServletInputStream {

    private ByteArrayInputStream bais;

    public XSServletInputStream(ByteArrayInputStream bais) {
        this.bais = bais;
    }

    @Override
    public boolean isFinished() {
        return false;
    }

    @Override
    public boolean isReady() {
        return false;
    }

    @Override
    public void setReadListener(ReadListener listener) {
    }

    @Override
    public int read() throws IOException {
        return bais.read();
    }
}
